import DEFINE = require('./../../common/DEFINE');
import GCJ_CLASS_TYPE = require('./../../common/GCJ_CLASS_TYPE');
import Serializer = require('./Serializer');
var CONFIG=require('../../../../common/config');
export  = SJGPageContentDescribe;

/**
 *
 * @author 
 *
 */
class SJGPageContentDescribe extends Serializer{
    public page_content_index = 0;   // page content index,把SJGPage当作SJGPageContent用
    public page_content_id = 0;      // editor's page content id 
    public db_page_content_id=0;     // db page content's index
    
    public page_index=0;     // page index
    
    
	public constructor() {
        super();
        this.ct = GCJ_CLASS_TYPE.CLASS_TYPE_SJGPageContentDescribe;
	}
	
    // 从json对象(注意不是json字符串)中解析
    public fromJson(jsonObj, versionId) { 
        super.fromJson( jsonObj, versionId );
        
        this.page_content_index=jsonObj.page_content_index;
        this.page_content_id=jsonObj.page_content_id;
        this.db_page_content_id=jsonObj.db_page_content_id;
        
        this.page_index=jsonObj.page_index;
        
    }
    // 转成json字符串
    public toJson():string {                                                                      
        // 去掉父json字符串的头尾
        var superJson = super.toJson();
        superJson = superJson.substr(1,superJson.length-2);
                        
        var ret = '{';
            ret +=superJson;   
                        
            // page_content_index
            ret +=',';
            ret+= '"page_content_index":';
            ret+=this.page_content_index;
                    
            // page_content_id
            ret +=',';
            ret+= '"page_content_id":';
            ret+=this.page_content_id;
            
            // db_page_content_id
            ret+=',';
            ret+='"db_page_content_id":';
            ret+=this.db_page_content_id;
            
            // page_index
            ret+=',';
            ret+='"page_index":';
            ret+=this.page_index;
            
            
                                                                                                                                            
            ret+='}';
            return ret;
        }   
}//SJG_MARK_END-------------------------


